package cn.yunhe.controller;


import cn.yunhe.entity.Field;
import cn.yunhe.service.FieldService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/Field")
public class FieldController {

    @Resource
    private FieldService fieldService;

    /**
     * 获取所有分类
     * @return
     * 郭瀚钰
     */
    @RequestMapping("/getAllField")
    public Map<String,Object> getAllField(){
        Map map = new HashMap();
        List<Field> fieldList = fieldService.getAllField();
        map.put("fieldList", fieldList);
        return map;
    }


    public FieldService getFieldService() {
        return fieldService;
    }

    public void setFieldService(FieldService fieldService) {
        this.fieldService = fieldService;
    }
}
